# Group FAQ
FAQs related to the events.

| Parameter | Description | Type | Required |
|:----------|-------------|------|----------|
| `question`  | Frequently Asked Questions related to the Event | string | **yes** |
| `answer` | Answer to the Frequently Asked Questions | string | **yes** |



## FAQ Collection [/v1/faqs{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `1`) - Page number to fetched for the paginated response.
    + sort (optional, string, `question`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/iltering.html for more.

### Create FAQ [POST]
Create a new Question-Answer pair (FAQ) with event_id.

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "type": "faq",
                "relationships": {
                      "event": {
                        "data": {
                          "type": "event",
                          "id": "1"
                        }
                      }
                    },
                "attributes": {
                      "question": "Sample Question",
                      "answer": "Sample Answer"
                    }
                }
            }


+ Response 201 (application/vnd.api+json)

        {
            "data": {
                "relationships": {
                    "faq-type": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/faq-type",
                            "related": "/v1/faqs/1/faq-type"
                        }
                    },
                    "event": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/event",
                            "related": "/v1/faqs/1/event"
                        }
                    }
                },
                "attributes": {
                    "question": "Sample Question",
                    "deleted-at": null,
                    "answer": "Sample Answer"
                },
                "type": "faq",
                "id": 1,
                "links": {
                    "self": "/v1/faqs/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/faqs/1"
            }
        }


## FAQ Detail [/v1/faqs/{faq_id}]
+ Parameters
    + faq_id: 1 (integer) - ID of the FAQ in the form of an integer

### FAQ Detail [GET]
Get a single FAQ.

+ Request

    + Headers

            Accept: application/vnd.api+json

+ Response 200 (application/vnd.api+json)

        {
            "data": {
                "relationships": {
                    "event": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/event",
                            "related": "/v1/faqs/1/event"
                        }
                    },
                    "faq-type": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/faq-type",
                            "related": "/v1/faqs/1/faq-type"
                        }
                    }
                },
                "attributes": {
                    "question": "Sample Question",
                    "answer": "Sample Answer",
                    "deleted-at": null
                },
                "type": "faq",
                "id": 1,
                "links": {
                    "self": "/v1/faqs/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/faqs/1"
            }
        }


### Update FAQ [PATCH]
Update a single FAQ with `id`.

+ `id` (integer) - ID of the record to update **(required)**

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "type": "faq",
                "attributes": {
                    "question": "Sample Question",
                    "answer": "Sample Answer Changed"
                },
                "id": "1"
              }
            }


+ Response 200 (application/vnd.api+json)

        {
            "data": {
                "relationships": {
                    "faq-type": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/faq-type",
                            "related": "/v1/faqs/1/faq-type"
                        }
                    },
                    "event": {
                        "links": {
                            "self": "/v1/faqs/1/relationships/event",
                            "related": "/v1/faqs/1/event"
                        }
                    }
                },
                "attributes": {
                    "question": "Sample Question",
                    "deleted-at": null,
                    "answer": "Sample Answer Changed"
                },
                "type": "faq",
                "id": 1,
                "links": {
                    "self": "/v1/faqs/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/faqs/1"
            }
        }

### Delete FAQ [DELETE]
Delete a single FAQ.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }


## Event FAQ Collection [/v1/events/{event_identifier}/faqs{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + event_identifier: 1 (string) - identifier or event id of the event. (b8324ae2 is an example of identifier)
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `1`) - Page number to fetched for the paginated response.
    + sort (optional, string, `question`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/iltering.html for more.

### List All FAQs for an Event [GET]
Get a list of FAQs for an event.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>


+ Response 200 (application/vnd.api+json)


        {
            "meta": {
                "count": 1
            },
            "data": [
                {
                    "relationships": {
                        "faq-type": {
                            "links": {
                                "self": "/v1/faqs/1/relationships/faq-type",
                                "related": "/v1/faqs/1/faq-type"
                            }
                        },
                        "event": {
                            "links": {
                                "self": "/v1/faqs/1/relationships/event",
                                "related": "/v1/faqs/1/event"
                            }
                        }
                    },
                    "attributes": {
                        "question": "Sample Question",
                        "deleted-at": null,
                        "answer": "Sample Answer"
                    },
                    "type": "faq",
                    "id": 1,
                    "links": {
                        "self": "/v1/faqs/1"
                    }
                }
            ],
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/events/1/faqs"
            }
        }
